package com.yjymm.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.env.Environment;

import java.util.UUID;

/**
 * @author yjymm
 * @date 2020-04-12 11:05
 */
public class MyCommandLineRunner implements CommandLineRunner {
    Environment environment;

    private  final Logger logger = LoggerFactory.getLogger(MyCommandLineRunner.class);

    @Override
    public void run(String... args) throws Exception {
//        logger.info("利用springboot自动装配原理配置自定义CommandLineRunner");
//        logger.info("生成随机字符串：".concat(environment.getProperty("random.")));
        System.out.println("利用springboot自动装配原理配置自定义CommandLineRunner");
        System.out.println("生成随机字符串：".concat(environment.getProperty("random.")));
    }

    public MyCommandLineRunner(Environment environment) {
        this.environment = environment;
    }
}
